<?php
	$JO[ "subject"		] = JO( array( "EN" => "Subject",		"KO" => "제목",	"VI" => "Tựa Đề"		) );
	$JO[ "release"		] = JO( array( "EN" => "Release",		"KO" => "출시",	"VI" => "Phát Hành"		) );
	$JO[ "birth"	 	] = JO( array( "EN" => "Birth",			"KO" => "생일",	"VI" => "Ngày Sinh"		) );
	$JO[ "date"		 	] = JO( array( "EN" => "Date",			"KO" => "날짜",	"VI" => "Ngày"			) );
	$JO[ "Nation"		] = JO( array( "EN" => "Nation",						"VI" => "Quốc Gia"		) );
	$JO[ "Streamthis"	] = JO( array( "EN"=> "Stream This",					"VI" => "Nghe Nhạc"		) );
	$JO[ "DownThis"	 	] = JO( array( "EN"=> "Download This",					"VI" => "Tải về"		) );
	$JO["episode"		] = JO( array( "EN"=> "Episode",						"VI"=>"Tập"				) );
	$JO["add_day"		] = JO( array( "EN"=> "Date",							"VI"=>"Ngày Tạo"		) );
	
	$JO[ "StreamAllchecked" ]	= JO( array( 
		"EN"=>"Stream Every Checked Item",
		"VI"=>"Nghe Tất Cả Bài Hát Đã Chọn"
	) );
	
	$JO[ "DownAllChecked" ] 	= JO( array( 
		"EN"=>"Download Every Checked Item",
		"VI"=>"Tải Tất Cả Bài Hát Đã Chọn"
	) );
	
	$JO[ "PutChecked2favor" ]	= JO( array(
		"EN"=>"Put Every Checked item in My Favorite",
		"VI"=>"Đưa Các Bài Đã Chọn Vào Mục Yêu Thích"
	));
	
	$JO[ "Put2favorite" ]		= JO( array(
		"EN"=>"Put This in My Favorite",
		"VI"=>"Đưa Vào Mục Yêu Thích"
	));
	
	$JO[ "alert" ] 				= JO( array( 
		"EN"=>"Please check the items that you want to put in your favorite.",
		"VI"=>"Xin hãy chọn bài hát mà bạn muốn đưa vào mục yêu thích."
	));
	
	
	$JO[ "no result" ] 			= JO( array(
		"EN" => "There is no search result.",
		"KO" => "검색 결과가 없습니다.",
		"VI" => "Không có kết quả tìm kiếm phù hợp."
	) );
	
	
	
	$JO[ "MoreResult" ]		= JO( array(
		"EN" => "Watch More Search Results",
		"KO" => "더 많은 검색 결과 보기",
		"VI" => "Kết Quả Tìm Kiếm Khác"
	) );
	
	$JO[ "NoticeWatchMore" ]	= JO( array(
		"EN" => "Please click 'Watch More Search Results' and you can watch more search results of each category.",
		"KO" => "'더 많은 검색 결과 보기'를 클릭하시면 각 분류의 더 많은 검색 결과를 보실 수 있습니다.",
		"VI" => "Hãy nhấn [mã nhạc chờ] tại mục nhạc chờ của nhà mạng Viettel và mobifone để nghe thử nhạc chờ."
	) );
	
?>
<?

	/*

		검색 단어에 특수한 문법을 쓰면 장르, 국가 등을 제한 할 수 있다.

	*/

	



	if( $_REQUEST[ "JO_search_type" ] == "all" )	$preview = 5;
	else											$preview = 20;

	if( empty( $_REQUEST[ "JO_search_page" ] ) ) $_REQUEST[ "JO_search_page" ] = 1;
	
	function JO_Get_rbt_code($s_telco,$s_rbtcode,$s_note){
		$arr_temp = array();
		//$arr_temp = explode("\n",$s_rbtcode);
		$arr_temp = split(";",$s_rbtcode);
		$s_temp = "";
		foreach ($arr_temp as $s_value){
			$s_temp .= "
				<span
					style=\"cursor: pointer;\"
					onMouseover='ddrivetip(\"$s_telco\",\"".$s_value."\",\"".$s_note."\");'
					onMouseout='hideddrivetip();'
					onClick=\"showobj('JO_60_WMPlayer.php?id=".trim($s_value,"  ")."&telco=".$s_telco."','rbtplayer');\"
				>
			";
			$s_temp .= $s_value;
			$s_temp .= "</span><br/>";
		}
		return $s_temp;
	}



	function JO_search_more( $amount, $type, $numpage ) {

		if( $_REQUEST[ "JO_search_type" ] != "all" ){
			echo "
					<h2> Có ".$amount." kết quả trên ".$numpage." trang</h2>
				";
		}else {

			global $preview;
	
			$title 	= JO( array(
						"EN" => "There are " . $amount . " search results.",
						"KO" => "모두 " . $amount . "개의 검색 결과가 있습니다.",
						"VI" => "Có " . $amount . " kết quả tìm kiếm."
						) );
	
			$button = JO( array(
						"EN" => "Watch More Search Results",
						"KO" => "더 많은 검색 결과 보기",
						"VI" => "Kết Quả Tìm Kiếm Khác"
						) );;
			
			if( $amount <= $preview ){
				return false;
			}
			else{
				echo "
					<h2>
		
						<a
							href	= '?JO_unit=20_search&JO_search_type=" . $type . "&JO_search=" . $_REQUEST[ "JO_search" ] . "'
							title	= '" . $title . "'
						>".$amount." ". $button . "</a>
		
					</h2>
				";
			}
		}

	}



	function JO_search_unit( $type ) {

		if( $_REQUEST[ "JO_search_type" ] != $type && $_REQUEST[ "JO_search_type" ] != "all" ) return false;

		global $JO;
		global $preview;

		echo "
			<div class='JO_bar_720'>
				<h1>" . $JO[ $type ] . "</h1>
		";
		
		$s_search=trim($_REQUEST[ "JO_search" ]," \t\n\r\0\x0B");
		//replace special character
		$s_special_character = array( "(", ")", "'","*","&","-"," ","_","!"," ","~","}","{","%","$","#","@",".","<",">");
		$s_search = str_replace("đ","d", $s_search);
		$s_search = str_replace($s_special_character,"", $s_search);

		switch( $type ) {

			case "artist": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`artist`
				WHERE	`delete` IS NULL
				AND (
							REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`name`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'<',''),'>','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`name_I18N`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'<',''),'>','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`autonym`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'<',''),'>','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`autonym_I18N`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'<',''),'>','')
							LIKE '%" .$s_search. "%'
					OR		`search`		LIKE '%" .$s_search. "%'
				)
			"; break;
			
			case "rbt": $query = "
				SELECT COUNT( `key` ) AS `count`
				from rbt_view
				WHERE		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`note`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'>',''),'<','')	
							LIKE '%" .$s_search. "%'
						OR 	REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`artist FKF`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'>',''),'<','')
							LIKE '%" .$s_search. "%'
			"; break;

			case "music": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`music`
				WHERE	`delete` IS NULL
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "album": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`album`
				WHERE	`delete` IS NULL
				AND		`type` = 'music'
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "video": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`video`
				WHERE	`delete` IS NULL
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "show": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`show`
				WHERE	`delete` IS NULL
				AND (
						`subject`		LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`description`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "drama": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`album`
				WHERE	`delete` IS NULL
				AND		`type` = 'drama'
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "movie": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`album`
				WHERE	`delete` IS NULL
				AND		`type` = 'movie'
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "fashion": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`fashion`
				WHERE	`delete` IS NULL
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "notice": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`content`
				WHERE	`delete` IS NULL
				AND		`unit` = 'notice'
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "magazine": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`content`
				WHERE	`delete` IS NULL
				AND		`unit` = 'magazine'
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

			case "favorite": $query = "
				SELECT	COUNT( `key` ) AS `count`
				FROM	`favorite`
				WHERE	`delete` IS NULL
				AND (
						`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
			"; break;

		}

		$recordSet = JO_query( $query );

		if( $recordSet -> num_rows ) $record = $recordSet -> fetch_array( );

		$amount = intval( $record[ "count" ] );
		$numpages = floor( ( $amount - 1 ) / $preview ) + 1;

		JO_search_more( $amount, $type, $numpages);

		echo "

				<div>

					<table>

						<tr>

		";



		////
		///
		//	Checkbox

			/*echo "

							<th
								class		= 'JO_top'
								style		= 'width: 4px;'
							><span
								class		= 'JO_relative'
							><input
								style		= 'visibility: visible;display: block;'
								type		= 'checkbox'
								id			= 'JO_search_checkbox_" . $type . "'
								class		= 'JO_checkbox'
								onchange	= 'JO_search_checkbox( \"" . $type . "\" );'
                                                                style='vertical-align: middle;'
							/></span></th>

			"; // Checkbox
			*/
		////
		///
		//	Subject

			if(	$type == "music"	||
				$type == "rbt"		||
				$type == "album"	||
				$type == "video"	||
				$type == "show"		||
				$type == "drama"	||
				$type == "movie"	||
				$type == "fashion"	||
				$type == "notice"	||
				$type == "magazine"	||
				$type == "favorite"	) echo"

							<th>" . $JO[ "subject" ] . "</th>

			"; // Subject

		////
		///
		//	Artist

			if(	$type == "artist"	||
				$type == "rbt"		||
				$type == "music"	||
				$type == "album"	||
				$type == "video"	||
				$type == "drama"	||
				$type == "movie"	) echo "

							<th>" . $JO[ "artist" ] . "</th>

			"; // Artist

		////
		///
		//	RBT code of Telco
			if(	$type == "rbt"		) echo "
							<th>Viettel		</th>
							<th>Mobifone	</th>
							<th>Vinaphone	</th>
							<th>Vietnamobile</th>
							<th>Sfone		</th>
							<th>Beeline		</th>
			";//RBT
			
		////
		///
		//	RBT code of Telco
			if(	$type == "show"		) echo "
							<th>".$JO["episode"]."</th>
							<th>".$JO["add_day"]."</th>
			";//RBT
				
		////
		///
		//	Birth

			if(	$type == "artist"	) echo "

							<th style='width: 60px;'>" . $JO[ "birth" ] . "</th>

			"; // Birth

		////
		///
		//	Release

			if(	$type == "music"	||
				$type == "album"	||
				$type == "video"	||
				$type == "drama"	||
				$type == "movie"	) echo "

							<th style='width: 60px;'>" . $JO[ "release" ] . "</th>

			"; // Release

		////
		///
		//	Date

			if(	$type == "notice"	||
				$type == "magazine"	) echo "

							<th style='width: 60px;'>" . $JO[ "date" ] . "</th>

			"; // Date
                ////

			if(	$type == "music"
                                                        ) echo "

							<th
								style		= 'width: 12px;'
							><a
								href		= '#this'
								title		= '".$JO[ "rbt" ]."'
								onclick		= 'document.getElementById(\"iframe_rbt\").src=\"http://www.dantri.com.vn\";setVisible(\"layer1\")'
							><img
								src			= 'JO_80_image/JO_33_icon_phone_off.png'
								class		= 'JO_icon'
								onmouseover	= 'this.src=\"JO_80_image/JO_33_icon_phone_on.png\";'
								onmouseout	= 'this.src=\"JO_80_image/JO_33_icon_phone_off.png\";'
							/></a></th>

			"; // RBT

		////
		///
		//	Voulme

			if(	$type == "album"	) echo "

							<th
								style		= 'width: 18px;'
							><img
								src			= 'JO_80_image/JO_42_icon_volume.png'
								title		= 'Volume'
								class		= 'JO_icon'
							/></th>

			"; // Volume

		////
		///
		//	Nation

			if(	$type == "artist"	||
				$type == "music"	||
				$type == "album"	||
				$type == "video"	||
				$type == "drama"	||
				$type == "movie"	) echo "

							<th
								style		= 'width: 12px;'
							><img
								src			= 'JO_80_image/JO_41_icon_nation.png'
								title		= '".$JO[ "Nation"]."'
								class		= 'JO_icon'
							/></th>

			"; // Nation

		////
		///
		//	Stream

			if(	$type == "music"	||
				$type == "album"	||
				$type == "video"	||
				$type == "drama"	||
				$type == "movie"	) echo "

							<th
								style		= 'width: 12px;'
							><a
								href		= '#this'
								title		= '".$JO[ "StreamAllchecked" ]."'
								onclick		= 'alert( \"Becasue of the copy right issue, this is not on the service, yet.\" );'
							><img
								src			= 'JO_80_image/JO_31_icon_stream_off.png'
								class		= 'JO_icon'
								onmouseover	= 'this.src=\"JO_80_image/JO_31_icon_stream_on.png\";'
								onmouseout	= 'this.src=\"JO_80_image/JO_31_icon_stream_off.png\";'
							/></a></th>

			"; // Stream

		////
		///
		// Download

			if(	$type == "music"	||
				$type == "album"	) echo "

							<th
								style		= 'width: 12px;'
							><a
								href		= '#this'
								title		= '".$JO[ "DownAllChecked" ]."'
								onclick		= 'alert( \"Becasue of the copy right issue, this is not on the service, yet.\" );'
							><img
								src			= 'JO_80_image/JO_32_icon_download_off.png'
								class		= 'JO_icon'
								onmouseover	= 'this.src=\"JO_80_image/JO_32_icon_download_on.png\";'
								onmouseout	= 'this.src=\"JO_80_image/JO_32_icon_download_off.png\";'
							/></a></th>

			"; // Download

		////
		///
		// Favorite

			if(	$_SESSION[ "JO_account_key" ] && (
				$type == "artist"	||
				$type == "music"	||
				$type == "album"	||
				$type == "video"	||
				$type == "drama"	||
				$type == "movie"	) ) {

				echo "

							<th style='width: 12px;'>

								<span class='JO_relative'>

									<div
										id			= 'JO_search_favorite_" . $type . "'
										class		= 'JO_select JO_normal'
										style		= 'position: absolute; padding: 2px; left: -221px; top: 6px; width: 234px;'
										onmouseover	= 'this.style.display = \"block\";'
										onmouseout	= 'this.style.display = \"none\";'
									>

										<img
											src		= 'JO_80_image/JO_34_icon_favorite_on.png'
											class	= 'JO_icon'
											style	= 'position: absolute; left: 220px; top: 4px;'
										/>

				";

				if( $_SESSION[ "JO_account_favorite" ][ $type ] ) foreach( $_SESSION[ "JO_account_favorite" ][ $type ] as $key => $value ) echo "

										<a
											href	= '#this'
											class	= 'JO_option'
											style	= 'width: 221px;'
											onclick	= '
												JO_search_favorite( \"" . $type . "\", \"" . $key . "\" );
												JO_display( \"JO_search_favorite_" . $type . "\" );
											'
										>" . $value . "</a>

				";

				else echo "

										<a
											href	= '#this'
											class	= 'JO_option'
											style	= 'width: 221px;'
											onclick	= '
												JO_search_favorite( \"" . $type . "\", \"\" );
												JO_display( \"JO_search_favorite_" . $type . "\" );
											'
										>Favorite " . ucwords( $type ) . "</a>

				";

				echo "

									</div>

									<a
										href		= '#this'
										title		= '".$JO[ "PutChecked2favor" ]."'
										onclick		= 'document.getElementById( \"JO_search_favorite_" . $type . "\" ).style.display = \"block\";'
									><img
										src			= 'JO_80_image/JO_34_icon_favorite_off.png'
										class		= 'JO_icon'
										onmouseover	= 'this.src=\"JO_80_image/JO_34_icon_favorite_on.png\";'
										onmouseout	= 'this.src=\"JO_80_image/JO_34_icon_favorite_off.png\";'
									/></a>

								</span>

							</th>

				";

			} // Favorite



		echo "

						</tr>

		";
		
		switch( $type ) {


			case "artist": $query = "
				SELECT		`key`,
							`name`,
							`autonym`,
							`birth`,
							`nation`
				FROM		`artist`
				WHERE		`delete` IS NULL
				AND (
							REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`name`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`name_I18N`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`autonym`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.','')
							LIKE '%" .$s_search. "%'
					OR		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`autonym_I18N`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.','')
							LIKE '%" .$s_search. "%'
					OR		`search`		LIKE '%" .$s_search. "%'
				)
				ORDER BY	`name` ASC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "music": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`album`,
							( SELECT `subject` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `album FKF`,
							( SELECT `release` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `release`,
							`nation`
				FROM		`music`
				WHERE		`delete` IS NULL
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;
			
			case "rbt": $query = "
				SELECT *
				from rbt_view
				WHERE		REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`note`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.',''),'>',''),'<','')	
							LIKE '%" .$s_search. "%'
							OR 	REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`artist FKF`,'đ','d'),'(',''),')',''),'\'',''),'&',''),'-',''),' ',''),'_',''),'!',''),'.','')
								LIKE '%" .$s_search. "%'
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;
							

			case "album": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`volume`,
							`nation`,
							`release`
				FROM		`album`
				WHERE		`delete` IS NULL
				AND			`type` = 'music'
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`release` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "video": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`album`,
							( SELECT `subject` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `album FKF`,
							( SELECT `release` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `release`,
							`nation`
				FROM		`video`
				WHERE		`delete` IS NULL
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "show": $query = "
				SELECT		`key`,
							`subject`,
							`description`,
							`episode`,
							`viewer`,
							`insert`
				FROM	`show`
				WHERE	`delete` IS NULL
				AND (
						`subject`		LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR	`description`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "drama": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`volume`,
							`nation`,
							`release`
				FROM		`album`
				WHERE		`delete` IS NULL
				AND			`type` = 'drama'
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`release` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "movie": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`volume`,
							`nation`,
							`release`
				FROM		`album`
				WHERE		`delete` IS NULL
				AND			`type` = 'movie'
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`release` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "fashion": $query = "
				SELECT		`key`,
							`subject`,
							`artist`,
							`JC_FK_artist.name`( `artist` ) AS `artist FKF`,
							`album`,
							( SELECT `subject` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `album FKF`,
							( SELECT `release` FROM `album` WHERE `album`.`key` = `music`.`album` ) AS `release`,
							`nation`
				FROM		`fashion`
				WHERE		`delete` IS NULL
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "notice": $query = "
				SELECT		`key`,
							`subject`,
							`insert`
				FROM		`content`
				WHERE		`delete` IS NULL
				AND			`unit` = 'notice'
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "magazine": $query = "
				SELECT		`key`,
							`subject`,
							`insert`
				FROM		`content`
				WHERE		`delete` IS NULL
				AND			`unit` = 'magazine'
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

			case "favorite": $query = "
				SELECT		`key`,
							`subject`,
							`insert`
				FROM		`favorite`
				WHERE		`delete` IS NULL
				AND (
							`subject`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`content`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
					OR		`search`	LIKE '%" . $_REQUEST[ "JO_search" ] . "%'
				)
				ORDER BY	`insert` DESC
				LIMIT		" . ( $_REQUEST[ "JO_search_type" ] == $type ? ( ( intval( $_REQUEST[ "JO_search_page" ] ) - 1 ) * $preview ) . ", " . $preview : $preview ) . "
			"; break;

		}
		
		$recordSet = JO_query( $query );
		$s_lctelco = "";
		$s_lcnote = "";
		$count = 0;

		if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {

			echo "

						<tr>
			";
			
			$count ++;
			////
			///
			//	Checkbox

				/*echo "

							<td><span
								class	= 'JO_relative'
							><input
								style	= 'visibility: hidden;display: block;'
								type	= 'checkbox'
								id		= 'JO_search_checkbox_" . $type . "_" . $count ++ . "'
								value	= '" . $record[ "key" ] . "'
								class	= 'JO_checkbox'
							/></span></td>

				"; // Checkbox
				*/
			////
			///
			//	Subject

				if(	$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"	||
					$type == "fashion"	||
					$type == "notice"	||
					$type == "magazine"	||
					$type == "favorite"	) echo"

							<td><a href='?JO_album=" . $record[ "key" ] . "'>" . $record[ "subject" ] . "</a></td>

				"; // Subject
					
			////
			///
			//	rbt name
				if(	$type == "rbt"){
					if(($s_lcnote ==""||$s_lcnote!=$record[ "note" ])&& ($s_lctelco==""||$s_lctelco!=$record[ "telco" ])){
						$s_lctelco = $record[ "telco" ];
						$s_lcnote = $record[ "note" ];
					}
					
					
					echo "
							<td><a href='#'>" 	. $record[ "note" ]	. "</a></td>
							
							<td>". $record[ "artist FKF"]	."</td>
							
							<td
								
							>".JO_Get_rbt_code("VTL8x88",$record[ "viettel" ],$record[ "note" ])."</td>
							
							<td
							>".JO_Get_rbt_code("VMS8x88",$record[ "mobifone" ],$record[ "note" ])."</td>
							
							<td
							>".JO_Get_rbt_code("GPC8x88",$record[ "vinaphone" ],$record[ "note" ])."</td>
							
							<td
							>".JO_Get_rbt_code("VNM8x88",$record[ "vietnamobile" ],$record[ "note" ])."</td>
							
							<td>".$record[ "sfone" ]."</td>
							
							<td>".$record[ "beeline" ]."</td>
					";
				}//rbt
				
			////
			///
			//	Show
				if(	$type == "show"){
					echo "
						<td><a href='#'>".$record[ "subject" ]. "</a></td>
						<td>" . $record[ "episode" ]. "</td>
						<td>" .  JO_date($record[ "insert" ]). "</td>
					";
				}

			////
			///
			//	Artist

				if(	$type == "artist"	) echo "

							<td><a href='?JO_artist=" . $record[ "key" ] . "'>" . $record[ "name" ] . "</a></td>

				"; // Artist

				if(	$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"	) echo "

							<td>" . JO_artist( $record[ "artist FKF" ] ) . "</td>

				"; // Artist

			////
			///
			//	Birth

				if(	$type == "artist"	) echo "

							<td>" . JO_date( $record[ "birth" ] ) . "</td>

				"; // Birth

			////
			///
			//	Release

				if(	$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"	) echo "

							<td>" . JO_date( $record[ "release" ] ) . "</td>

				"; // Release

			////
			///
			//	Date

				if(	$type == "notice"	||
					$type == "magazine"	) echo "

							<td>" . JO_date( $record[ "insert" ] ) . "</td>

				"; // Date
                        ////
			///
			//	RBT

				if(	$type == "music"
                                                                ) echo "

							<td
								style		= 'width: 12px;'
							><a
								href		= '#i'
								title		= '".$JO[ "rbt" ]."'
								onclick		= 'document.getElementById(\"iframe_rbt\").src=\"JO_25_RBT.php?id=".$record["key"]."\";setVisible(\"layer1\");'
							><img
								src			= 'JO_80_image/JO_33_icon_phone_off.png'
								class		= 'JO_icon'
								onmouseover	= 'this.src=\"JO_80_image/JO_33_icon_phone_on.png\";'
								onmouseout	= 'this.src=\"JO_80_image/JO_33_icon_phone_off.png\";'
							/></a></td>

				"; // RBT


			////
			///
			//	Voulme

				if(	$type == "album"	) echo "

							<td class='JO_right'>" . $record[ "volume" ] . "</td>

				"; // Volume

			////
			///
			//	Nation

				if(	$type == "artist"	||
					$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"	) echo "

							<td><img
								src		= 'JO_80_image/JO_41_icon_nation/" . $record[ "nation" ] . ".png'
								title	= '" . $record[ "nation" ] . "'
								class	= 'JO_icon'
							/></td>

				"; // Nation

			////
			///
			//	Stream

				if(	$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"	) echo "

								<td><a
									href		= '#this'
									title		= '".$JO[ "Streamthis" ]."'
									onclick		= 'alert( \"Becasue of the copy right issue, this is not on the service, yet.\" );'
								><img
									src			= 'JO_80_image/JO_31_icon_stream_off.png'
									class		= 'JO_icon'
									onmouseover	= 'this.src=\"JO_80_image/JO_31_icon_stream_on.png\";'
									onmouseout	= 'this.src=\"JO_80_image/JO_31_icon_stream_off.png\";'
								/></a></td>

				"; // Stream

			////
			///
			// Download

				if(	$type == "music"	||
					$type == "album"	) echo "

								<td><a
									href		= '#this'
									title		= '".$JO[ "DownThis" ]."'
									onclick		= 'alert( \"Becasue of the copy right issue, this is not on the service, yet.\" );'
								><img
									src			= 'JO_80_image/JO_32_icon_download_off.png'
									class		= 'JO_icon'
									onmouseover	= 'this.src=\"JO_80_image/JO_32_icon_download_on.png\";'
									onmouseout	= 'this.src=\"JO_80_image/JO_32_icon_download_off.png\";'
								/></a></td>

			";

			////
			///
			// Favorite

				if(	$_SESSION[ "JO_account_key" ] && (
					$type == "artist"	||
					$type == "music"	||
					$type == "album"	||
					$type == "video"	||
					$type == "drama"	||
					$type == "movie"
				) ) {

					echo "

							<td>

								<span class='JO_relative'>

									<div
										id			= 'JO_search_favorite_" . $type . "_" . $record[ "key" ] . "'
										class		= 'JO_select JO_normal'
										style		= 'position: absolute; padding: 2px; left: -221px; top: 6px; width: 234px;'
										onmouseover	= 'this.style.display = \"block\";'
										onmouseout	= 'this.style.display = \"none\";'
									>

										<img
											src		= 'JO_80_image/JO_34_icon_favorite_on.png'
											class	= 'JO_icon'
											style	= 'position: absolute; left: 220px; top: 4px;'
										/>

					";

					if( $_SESSION[ "JO_account_favorite" ][ $type ] ) foreach( $_SESSION[ "JO_account_favorite" ][ $type ] as $key => $value ) echo "

										<a
											href	= 'JO_05_execution.php?JO_query=favorite_update&JO_favorite_key=" . $key . "&JO_favorite_foreign=" . $record[ "key" ] . "'
											target	= 'JO_integration_asynchronous'
											class	= 'JO_option'
											style	= 'width: 221px;'
											onclick	= 'JO_display( 'JO_search_favorite_" . $type . "_" . $record[ "key" ] . "' );'
										>" . $value . "</a>

					";

					else echo "

										<a
											href	= 'JO_05_execution.php?JO_query=favorite_update&JO_favorite_subject=" . urlencode( "Favorite Album" ) . "&JO_favorite_type=" . $type . "&JO_favorite_foreign=" . $record[ "key" ] . "'
											target	= 'JO_integration_asynchronous'
											class	= 'JO_option'
											style	= 'width: 221px;'
											onclick	= 'JO_display( 'JO_search_favorite_" . $type . "_" . $record[ "key" ] . "' );'
										>Favorite Album</a>

					";

					echo "

									</div>

									<a
										href		= '#this'
										title		= '".$JO[ "Put2favorite" ]."'
										onclick		= 'document.getElementById( \"JO_search_favorite_" . $type . "_" . $record[ "key" ] ."\" ).style.display = \"block\";'
									><img
										src			= 'JO_80_image/JO_34_icon_favorite_off.png'
										class		= 'JO_icon'
										onmouseover	= 'this.src=\"JO_80_image/JO_34_icon_favorite_on.png\";'
										onmouseout	= 'this.src=\"JO_80_image/JO_34_icon_favorite_off.png\";'
									/></a>

								</span>

							</td>

					";

				} // Favorite



			echo "

						</tr>

			";

		}

		if( $count == 0 ) echo "

						<tr><td colspan='9' class='JO_center'>" . $JO[ "no result" ] . "</td></tr>

		";

		if( $_REQUEST[ "JO_search_type" ] == $type ) {

			$numpages = floor( ( $amount - 1 ) / $preview ) + 1;
			$page=$_REQUEST["JO_search_page"];
			if($numpages>1){
					echo "
						<tr><td colspan='9' class='JO_center'>
					";

                    if($page>2){
                    ?>
                        <a href="#" onclick="sendurl('1');">◀</a>
                    <?
                    }
                    if($page>1){
                    ?>
                        <a href="#" onclick="sendurl('<?=($page-1)?>');">◁</a>

                    <?
                    }
                    if($page-4>1) echo "...";
                    for($i=$page-4;$i<=($page-1);$i++){
                        if($i>0){
                        ?>
                        <a href="#" onclick="sendurl('<?=$i?>');"><?=$i?></a>
                        <?
                        }
                    }
                    echo  "<b style='color=#ffffff;'>".$page."</b>";
                    for($i=$page+1;$i<=($page+4);$i++){
                        if($i<=$numpages){
                        ?>
                        <a href="#" onclick="sendurl('<?=$i?>');"><?=$i?></a>
                        <?
                        }
                    }
                    if($page+4<$numpages) echo "...";
                    if($page<$numpages){
                    ?>
                        <a href="#" onclick="sendurl('<?=($page+1) ?>');">▷</a>
                    <?
                    }
                    if($page<($numpages-1)){
                    ?>
                        <a href="#" onclick="sendurl('<?=$numpages ?>');">▶</a>

                    <?
                    }
                    echo "</td></tr>";
                }
		}

		echo "

					</table>

					<script> JO_search_count[ '" . $type . "' ] = " . $count . "; </script>

				</div>

			</div>

		";

	}

?>



<script>

	var JO_search_count = Array( );

	function JO_search_checkbox( type ) {

		for( i = 0; i < JO_search_count[ type ]; i ++ ) document.getElementById( "JO_search_checkbox_" + type + "_" + i ).checked = document.getElementById( "JO_search_checkbox_" + type ).checked;

	}

	function JO_search_favorite( type, key_favorite ) {

		key_foreign = "";

		for( i = 0; i < JO_search_count[ type ]; i ++ ) if( document.getElementById( "JO_search_checkbox_" + type + "_" + i ).checked ) key_foreign += document.getElementById( "JO_search_checkbox_" + type + "_" + i ).value + ";";

		if( ! key_foreign ) {

			alert( "<?= $JO[ "alert" ] ?>" );

			return false;

		}

		if( key_favorite ) {

			document.getElementById( "JO_integration_asynchronous" ).src = "JO_05_execution.php?JO_query=favorite_update&JO_favorite_key=" + key_favorite + "&JO_favorite_foreign=" + key_foreign;

		} else {

			document.getElementById( "JO_integration_asynchronous" ).src = "JO_05_execution.php?JO_query=favorite_update&JO_favorite_subject=" + type + "&JO_favorite_type=" + type + "&JO_favorite_foreign=" + key_foreign;

		}

	}

</script>



<div class="JO_page">

	<h1><?= JO( array(
		"EN" => "Search",
		"KO" => "검색",
		"VI" => "Tìm kiếm"
	) ) ?></h1>

	<h2 class="JO_normal" style="color: #7D7D7D;"><?= $JO[ "NoticeWatchMore" ] ?></h2>

</div>



<div class="JO_relative" style="width: 960px;">

	<div id="rbtplayer" class="JO_left JO_box_240" style="margin-bottom: 8px;padding: 0px;width: 232px; border: 0px;">&nbsp;
	</div>
	

	<div class="JO_left">
	<!--=========================================================-->

		
		<?
			JO_search_unit( "artist"	);
			JO_search_unit( "rbt"		);
			//JO_search_unit( "music"		);
			//JO_search_unit( "album"		);
			//JO_search_unit( "video"		);
			JO_search_unit( "show"		);
			//JO_search_unit( "drama"		);
			//JO_search_unit( "movie"		);
			//JO_search_unit( "fashion"	);
			//JO_search_unit( "notice"	);
			//JO_search_unit( "magazine"	);
			//JO_search_unit( "favorite"	);
		?>
	</div>
</div>
   <div style="width:100%;height:100%;float:left;position:fixed;left:0px;top:0px;visibility: hidden;z-index: 1;" id="msgpopup">
    <DIV id=layer1>
<!--        <table style="width: 100%">
            <tr><th id="jo_subjecttitle">Subject</th></tr>
        </table>-->
        <SPAN id=close style="top: 4px;right:4px;position: absolute;z-index: 3;">
            <A style="TEXT-DECORATION: none;"
               href="javascript:setVisible('layer1')">
                <img
                    src="JO_80_image/JO_23_icon_delete_off.png" alt=""
                    onmouseover	= "this.src='JO_80_image/JO_23_icon_delete_on.png';"
                    onmouseout="this.src='JO_80_image/JO_23_icon_delete_off.png';"
                />
            </A></SPAN>

        <iframe id="iframe_rbt"
                src="" width="100%"
                height="100%"
                style="position: relative;border: 0px"
                frameborder="0"
                scrolling="no"
                
                ></iframe>
    </DIV>
</div>
<div id="dhtmltooltip"></div>
<script type="text/javascript">
var offsetxpoint=-60; //Customize x offset of tooltip
var offsetypoint=20; //Customize y offset of tooltip
var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;
if (ie||ns6)
	var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";

function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function ddrivetip(telco,rbtcode,subject){

if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px";
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor;
var taitin="",noidung="";
switch(telco){
    case "VTL8x88"://viettel
        taitin="Vui lòng soạn tin nhắn <span style='color:red;'><b>BH</b> <b>"+rbtcode+"</b></span> gửi <b style='color:red;'>1221</b> (5,000 VND/SMS).<br/>Nếu bạn chưa đăng ký địch vụ nhạc chờ, hãy soạn tin <b>DK</b> gửi <b>1221</b> để đăng ký sử dụng dịch vụ nhạc chờ.";
        noidung="";
        break;
        
    case "VMS8x88"://mobi
        taitin="Vui lòng soạn tin nhắn <span style='color:red;'><b>CHON</b> <b>"+rbtcode+"</b></span> gửi <b style='color:red;'>9224</b> (5,000 VND/SMS).<br/>Nếu bạn chưa đăng ký địch vụ nhạc chờ, hãy soạn tin <b>DK</b> gửi <b>9224</b> để đăng ký sử dụng dịch vụ nhạc chờ.";
        break;
    case "GPC8x88"://vina
        taitin="<br/>-Bước 1:Soạn tin <span style='color:red;'><b>STUNE</b> <b>"+rbtcode+"</b></span> gửi <b style='color:red;'>9194</b>.<br/>";
        taitin+="-Bước 2: Soạn tin <span style='color:red;'><b>MD</b> <b>"+rbtcode+"</b></span> gửi <b>9194</b>.(5,000 VND/SMS).";
        break;
    case "VNM8x88"://vnmobi
        taitin="Vui lòng soạn tin nhắn <span style='color:red;'><b>MUA</b> <b>"+rbtcode+"</b></span> gửi <b style='color:red;'>2345</b> (5,000 VND/SMS).<br/>Nếu bạn chưa đăng ký địch vụ nhạc chờ, hãy soạn tin <b>DK HR</b> gửi <b>123</b> để đăng ký sử dụng dịch vụ nhạc chờ.";
        break;
    case "SFN8x88"://sfone
        //taitin="Vui lòng soạn tin nhắn <span style='color:red;'><b>CHON</b> <b>"+rbtcode+"</b></span> gửi <b style='color:red;'>9224</b>(5,000 VND/SMS).<br/>Nếu bạn chưa đăng ký địch vụ nhạc chờ, hãy soạn tin <b>DK</b> gửi <b>1221</b> để đăng ký sử dụng dịch vụ nhạc chờ.";
        break;
    //thieu beeline

}
var content="";
content+="<div class='tippromotion' style='width:454px; height:130px;background-color:#ffffff;float:left;padding:4px 8px 4px 8px;'>";
content+=" <div style='width:454px;float:left;'>Để Tải Bài Hát <b style='color:blue;'>"+subject+"</b> Làm Nhạc Chờ, "+taitin+"<br/>";
content+="Dịch vụ tìm nhạc chờ:<br/>";
content+="-Tìm kiếm nhạc chờ theo Tên Bài Hát soạn tin <b>HQ S</b> &lt;<b>Tên Bài Hát</b>&gt; gửi <b>8388</b> (hoặc 8588).<br/>";
content+="-Tìm kiếm nhạc chờ theo Ca Sĩ soạn tin <b>HQ A</b> &lt;<b>Tên Ca Sĩ</b>&gt; gửi <b>8388</b> (hoặc 8588).<br/>";
content+="-Tìm kiếm nhạc chờ theo Thể Loại soạn tin <b>HQ G</b> &lt;<b>Tên Thể Loại</b>&gt; gửi <b>8388</b> (hoặc 8588).<br/>";
content+="</div></div>";
tipobj.innerHTML=content;
tipobj.style.top=200;
if(rbtcode=="")
	enabletip=false;
else
	enabletip=true;
return false;
}
}



function positiontip(e){
	if (enabletip){
		var curX=(ns6)?e.pageX : event.clientX;//+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY;//+ietruebody().scrollTop;
		//Find out how close the mouse is to the corner of the window
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
		
		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;
		
		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge<tipobj.offsetWidth)
		//move the horizontal position of the menu to the left by it's width
			tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px";
		else if (curX<leftedge)
			tipobj.style.left="5px";
		else
		//position the horizontal position of the menu where the mouse is positioned
			tipobj.style.left=curX+offsetxpoint+"px";
		
		//same concept with the vertical position
		//if (bottomedge<tipobj.offsetHeight)
		//tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-20+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-20+"px"
		//else
		tipobj.style.top=ie? event.clientY+10+"px":e.clientY+10+"px";
		
		tipobj.style.visibility="visible";
	}
}

function hideddrivetip(){
	if (ns6||ie){
		enabletip=false;
		tipobj.style.visibility="hidden";
		tipobj.style.left="-1000px";
		tipobj.style.backgroundColor='#ffffff';
		tipobj.style.width='';
	}
}

document.onmousemove=positiontip;
</script>
<style type="text/css">
    #dhtmltooltip{
        top: 0px;
        position: fixed;
        width: 470px;
        border: 1px solid #7D7D7D;
        padding: 0px;
        margin: 0px;
        background-color: #ffffff;
        
        z-index: 100;
        /*Remove below line to remove shadow. Below line should always appear last within this CSS*/
        
    }
</style>

<style type="text/css">
/*
     This script downloaded from www.JavaScriptBank.com
     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
*/
.jsbank_sample_cont {margin: 20px; padding: 20px;}
.jsbank_sample_tit {font-weight: bold; margin-bottom: 10px; padding: 5px; width: auto; background-color: #c0c0c0; border: 5px solid #a0a0a0; color: black; text-align: center;}
/*
Created by: Jeroen Haan
Web Site: http://www.haan.net/

*/
#layer1 {
	position: relative;
	visibility: hidden;
	width: 440px;
	height: 300px;
	z-index: 2;
	padding: 0px;
        border: 1px solid #000000;
}

#close {
	float: right;
}
</style>
<SCRIPT type="text/javascript">

function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('iframe_rbt').contentWindow.
document.body.scrollHeight;

//change the height of the iframe
document.getElementById('iframe_rbt').height=
the_height;
}

x = (screen.width/2);
y = (screen.height/2);
function setVisible(obj)
{
    calcHeight();
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	document.getElementById("msgpopup").style.visibility=obj.style.visibility;
}
function placeIt(obj)
{
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft = (screen.width/2)-(obj.offsetWidth /2)+52;
	theTop = (screen.height/2)-(obj.offsetHeight/2 )-40;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	setTimeout("placeIt('layer1')",500);
}
window.onscroll = setTimeout("placeIt('layer1')",500);
function sendurl(p){
    var jotype="<?=$_REQUEST["JO_search_type"];?>";
    var josearch="<?=$_REQUEST["JO_search"]?>";
    location=("JO_00_integration.php?JO_unit=20_search&JO_search_type="+jotype+"&JO_search="+josearch+"&JO_search_page="+p);
       
}

//Show WMP to play file
function showobj(url,obj) {
    document.getElementById(obj).innerHTML="<div style=\"height: 45px;text-align: center;background: url(JO_80_image/loading4.gif) center no-repeat\"><br/>Loadding...</div>";
    if (window.XMLHttpRequest) {
    xmlhttp=new XMLHttpRequest(); }
    else {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
	}
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById(obj).innerHTML=xmlhttp.responseText;
		}
	};
    xmlhttp.open("GET",url,true);
    xmlhttp.send();
}
</SCRIPT>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     